package com.tao.content.api;

import com.tao.base.model.Result;
import com.tao.content.domain.vo.CourseCategoryVo;
import com.tao.content.service.impl.CourseCategoryServiceImpl;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/course-category")
@RequiredArgsConstructor
@Tag(name = "课程分类接口",description = "管理课程分类")
public class CourseCategoryController {

    final CourseCategoryServiceImpl courseCategoryService;
    @GetMapping("/tree-nodes")
    @Operation(summary = "查询分类",description = "按照树形结构查询")
    public Result<List<CourseCategoryVo>> queryTreeNodes(){
        return Result.success(courseCategoryService.queryTreeNodes());
    }
}
